// $codepro.audit.disable numericLiterals
/**
 * Class: Create Treatment Record
 * Description:
 * 
 */

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextField;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;


import java.awt.Color;
import javax.swing.JSeparator;
import javax.swing.SwingConstants;
import javax.swing.JCheckBox;
import java.awt.Font;
import javax.swing.JScrollPane;


/**
 * @author Team Awesome Express
 * @version $ Revision 1.0 $
 */
public class CreateTreatmentRecord {

	/**
	 * Field treatmentFrame.
	 */
	private JFrame treatmentFrame;
	
	/**
	 * Field txtAttendNurse.
	 */
	private JTextField txtAttendNurse;
	
	/**
	 * Field txtComplaint.
	 */
	private JTextField txtComplaint;
	
	/**
	 * Field txtHeight.
	 */
	private JTextField txtHeight;
	
	/**
	 * Field txtWeight.
	 */
	private JTextField txtWeight;
	
	/**
	 * Field txtBloodPressure.
	 */
	private JTextField txtBloodPressure;
	
	/**
	 * Field txtPulse.
	 */
	private JTextField txtPulse;
	
	/**
	 * Field txtUserId.
	 */
	private JTextField txtUserId;
	
	/**
	 * Field txtTreatingDoctor.
	 */
	private JTextField txtTreatingDoctor;
	
	/**
	 * Field txtAppointDate.
	 */
	private JTextField txtAppointDate;
	
	/**
	 * Field txtTemp.
	 */
	private JTextField txtTemp;
	
	/**
	 * Field myDataManager.
	 */
	private DataManager myDataManager;
	
	/**
	 * Field checkIntegrity.
	 */
	private DataIntegrity checkIntegrity;

	/**
	 * Field txtPrescription
	 */
	private JTextField txtPrescription;

	/**
	 * Field txtDiagnosis
	 */
	private JTextField txtDiagnosis;

	/**
	 * Field txtFollow
	 */
	private JTextField txtFollow;

	/**
	 * Field txtNotes
	 */
	private JTextField txtNotes;

	/**
	 * All the JCHKBoxes n stuff
	 */
	private JCheckBox chkFluShot;

	/**
	 * Field chkTetanusShot.
	 */
	private JCheckBox chkTetanusShot;

	/**
	 * Field chkHeppatitusShot.
	 */
	private JCheckBox chkHeppatitusShot;

	/**
	 * Field chkSteroidShot.
	 */
	private JCheckBox chkSteroidShot;

	/**
	 * Field chkUrinalysis.
	 */
	private JCheckBox chkUrinalysis;

	/**
	 * Field chkBloodTest.
	 */
	private JCheckBox chkBloodTest;

	/**
	 * Field chkCholesterolTest.
	 */
	private JCheckBox chkCholesterolTest;

	/**
	 * Field chkHIV.
	 */
	private JCheckBox chkHIV;

	/**
	 * Field chkXRAY.
	 */
	private JCheckBox chkXRAY;

	/**
	 * Field chkCTSCAN.
	 */
	private JCheckBox chkCTSCAN;

	/**
	 * Field chkMRI.
	 */
	private JCheckBox chkMRI;

	/**
	 * Create the application.
	 * @param dataManager DataManager
	 * @param treatRecord TreatmentRecord
	 * @param rowNumber int
	 * @param p Patient
	 */
	public CreateTreatmentRecord(DataManager dataManager, TreatmentRecord treatRecord, int rowNumber, Patient p) { // Take in negative one if new treatmentRecord
		initialize(dataManager, treatRecord, rowNumber, p);
	}

	/**
	 * Initialize the contents of the frame.
	 * @param dataManager DataManager
	 * @param treatRecord TreatmentRecord
	 * @param rowNumber int
	 * @param p Patient
	 */
	private void initialize(DataManager dataManager, final TreatmentRecord treatRecord, final int rowNumber, Patient p) {
		this.myDataManager = dataManager;
		treatmentFrame = new JFrame();
		treatmentFrame.getContentPane().setBackground(GlobalVars.BACKGROUND);
	    treatmentFrame.setBounds(100, 100, 1000, 700);
		//treatmentFrame.setSize(1032, 668);
		treatmentFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		treatmentFrame.getContentPane().setLayout(null);

		final JLabel lblUserid = new JLabel("UserID :");
		lblUserid.setBounds(2, 57, 50, 16);

		final JLabel lblTreatingDoctor = new JLabel("Treating Doctor :");
		lblTreatingDoctor.setBounds(2, 96, 107, 16);
		
		final JLabel lblAppointDate = new JLabel("Appointment Date :");
		lblAppointDate.setBounds(2, 134, 123, 16);
		
		final JLabel lblAttendingNurse = new JLabel("Attending Nurse :");
		lblAttendingNurse.setBounds(2, 173, 111, 16);
		
		final JLabel lblTemp = new JLabel("Temperature :");
		lblTemp.setBounds(2, 377, 87, 16);
		
		final JLabel lblSymptoms = new JLabel("Symptoms: ");
		lblSymptoms.setBounds(2, 236, 110, 16);
		
		txtAttendNurse = new JTextField();
		txtAttendNurse.setBounds(133, 167, 143, 28);
		txtAttendNurse.setColumns(10);
		
		final JLabel nurseErr = new JLabel();
		nurseErr.setText("Invalid Nurse Name");
		nurseErr.setBounds(280, 167, 160, 28);
		nurseErr.setForeground(Color.RED);
		nurseErr.setVisible(false);
		
		txtComplaint = new JTextField();
		txtComplaint.setBounds(131, 218, 145, 52);
		txtComplaint.setColumns(10);
		
		final JLabel lblHeight = new JLabel("Height :");
		lblHeight.setBounds(2, 416, 66, 16);
		
		txtHeight = new JTextField();
		txtHeight.setBounds(133, 410, 148, 23);
		txtHeight.setColumns(10);
		
		final JLabel heightErr = new JLabel();
		heightErr.setBounds(286, 410, 160, 28);
		heightErr.setForeground(Color.RED);
		heightErr.setVisible(false);
		
		final JLabel lblWeight = new JLabel("Weight :");
		lblWeight.setBounds(1, 447, 51, 16);
		
		txtWeight = new JTextField();
		txtWeight.setBounds(133, 444, 150, 23);
		txtWeight.setColumns(10);
		
		final JLabel weightErr = new JLabel();
		weightErr.setBounds(286, 441, 160, 28);
		weightErr.setForeground(Color.RED);
		weightErr.setVisible(false);
		
		final JLabel lblBloodPressure = new JLabel("Blood Pressure :");
		lblBloodPressure.setBounds(2, 299, 100, 16);
		
		txtBloodPressure = new JTextField();
		txtBloodPressure.setBounds(133, 293, 143, 28);
		txtBloodPressure.setColumns(10);
		
		final JLabel bloodPrsErr = new JLabel();
		bloodPrsErr.setText("Invalid Entry");
		bloodPrsErr.setBounds(280, 293, 160, 28);
		bloodPrsErr.setForeground(Color.RED);
		bloodPrsErr.setVisible(false);
		
		final JLabel lblPulse = new JLabel("Pulse :");
		lblPulse.setBounds(2, 338, 41, 16);
		
		txtPulse = new JTextField();
		txtPulse.setBounds(133, 332, 143, 28);
		txtPulse.setColumns(10);
		
		final JLabel pulseErr = new JLabel();
		pulseErr.setText("Invalid Entry");
		pulseErr.setBounds(286, 332, 160, 28);
		pulseErr.setForeground(Color.RED);
		pulseErr.setVisible(false);
		
		final JLabel lblDiagnosis = new JLabel("Diagnosis :");
		lblDiagnosis.setBounds(2, 484, 87, 16);
		
		txtUserId = new JTextField();
		txtUserId.setBounds(133, 51, 143, 28);
		txtUserId.setColumns(10);
		
		/*final JLabel idErr = new JLabel("ID already exist");
		idErr.setBounds(286, 51, 160, 28);
		idErr.setForeground(Color.RED);
		idErr.setVisible(false);
		*/
		txtTreatingDoctor = new JTextField();
		txtTreatingDoctor.setBounds(133, 90, 143, 28);
		txtTreatingDoctor.setColumns(10);
		
		final JLabel doctorErr = new JLabel();
		doctorErr.setText("Invalid Doctor Name");
		doctorErr.setBounds(286, 90, 160, 28);
		doctorErr.setForeground(Color.RED);
		doctorErr.setVisible(false);
		
		txtAppointDate = new JTextField();
		txtAppointDate.setBounds(133, 128, 143, 28);
		txtAppointDate.setColumns(10);
		
		final JLabel apptDateErr = new JLabel("Enter Date(MM/dd/yyyy");
		apptDateErr.setBounds(280, 128, 160, 28);
		apptDateErr.setForeground(Color.RED);
		apptDateErr.setVisible(false);
		
		txtTemp = new JTextField();
		txtTemp.setBounds(133, 371, 145, 28);
		txtTemp.setColumns(10);
		
		final JLabel tempErr = new JLabel();
		tempErr.setBounds(280, 371, 160, 28);
		tempErr.setForeground(Color.RED);
		tempErr.setVisible(false);
		
		txtPrescription = new JTextField();
		txtPrescription.setBounds(695, 416, 247, 44);
		txtPrescription.setColumns(10);
		
		final JLabel lblPrescription = new JLabel("Prescription :");
		lblPrescription.setBounds(591, 433, 83, 16);
		
		txtDiagnosis = new JTextField();
		txtDiagnosis.setBounds(133, 478, 160, 28);
		txtDiagnosis.setColumns(10);
		
		final JLabel diagnosisErr = new JLabel("Enter diagnosis");
		diagnosisErr.setBounds(286, 478, 160, 28);
		diagnosisErr.setForeground(Color.RED);
		diagnosisErr.setVisible(false);
		
		txtFollow = new JTextField();
		txtFollow.setBounds(695, 478, 250, 44);
		txtFollow.setColumns(10);
		
		final JLabel labWorkLabel = new JLabel("Lab Work :");
		labWorkLabel.setBounds(500, 36, 66, 34);
		
		final JLabel lblNewLabel = new JLabel("Follow Up :");
		lblNewLabel.setBounds(591, 482, 94, 36);
		
		txtNotes = new JTextField();
		txtNotes.setBounds(696, 533, 249, 44);
		txtNotes.setColumns(10);
		
		final JButton btnCreate = new JButton("Save"); // 
		btnCreate.setBounds(689, 605, 84, 23);
		
		final JLabel lblNotes = new JLabel("Notes :");
		lblNotes.setBounds(591, 541, 45, 16);
		
		chkFluShot = new JCheckBox("Flu Shot");
		chkFluShot.setBounds(645, 101, 128, 23);
		
		chkTetanusShot = new JCheckBox("Tetanus Shot");
		chkTetanusShot.setBounds(645, 131, 128, 23);
		
		chkHeppatitusShot = new JCheckBox("Heppatitus Shot");
		chkHeppatitusShot.setBounds(798, 101, 147, 23);
		
		chkBloodTest = new JCheckBox("Blood Test");
		chkBloodTest.setBounds(645, 244, 128, 23);
		
		chkCholesterolTest = new JCheckBox("Cholesterol Test");
		chkCholesterolTest.setBounds(798, 216, 160, 23);
		
		chkUrinalysis = new JCheckBox("Urinalysis");
		chkUrinalysis.setBounds(645, 216, 128, 23);
		
		chkHIV = new JCheckBox("HIV");
		chkHIV.setBounds(798, 244, 128, 23);
		
		chkXRAY = new JCheckBox("X-RAY");
		chkXRAY.setBounds(645, 324, 128, 23);
		
		chkSteroidShot = new JCheckBox("Steroid Shot");
		chkSteroidShot.setBounds(798, 131, 128, 23);
		
		chkCTSCAN = new JCheckBox("CT SCAN");
		chkCTSCAN.setBounds(645, 355, 128, 23);
		
		chkMRI = new JCheckBox("MRI");
		chkMRI.setBounds(798, 324, 128, 23);
		if (treatRecord != null){
		// Fill in known values
		txtUserId.setText(treatRecord.getPatientUsername());
		txtAttendNurse.setText(treatRecord.getAttendingNurse());
		txtComplaint.setText(treatRecord.getComplaint());
		txtHeight.setText(treatRecord.getHeight());
		txtBloodPressure.setText(treatRecord.getBloodPressure());
		txtPulse.setText(treatRecord.getPulse());
		txtPrescription.setText(treatRecord.getPrescription());
		txtTreatingDoctor.setText(treatRecord.getTreatingDoctor());
		txtFollow.setText(treatRecord.getFollowUpInstructions());
		txtNotes.setText(treatRecord.getOtherInstructions());
		txtWeight.setText(treatRecord.getWeight());
		txtTemp.setText(treatRecord.getTemperature());
		txtDiagnosis.setText(treatRecord.getDiagnosis());
		txtAppointDate.setText(treatRecord.getCreationDate());
		populateCheckBoxes(treatRecord.getLabWork());
		
		if (dataManager.getUserType() == GlobalVars.PATIENT_USERTYPE) { // Panel is opened by a patient
			btnCreate.setVisible(false); // Hide the save button
			txtPrescription.setEnabled(false);
			// disable all doctors orders
			txtFollow.setEnabled(false);
			txtNotes.setEnabled(false);
			chkFluShot.setEnabled(false);
			chkBloodTest.setEnabled(false);
			chkCholesterolTest.setEnabled(false);
			chkMRI.setEnabled(false);
			chkCTSCAN.setEnabled(false);
			chkHIV.setEnabled(false);
			chkUrinalysis.setEnabled(false);
			chkSteroidShot.setEnabled(false);
			chkTetanusShot.setEnabled(false);
			chkTetanusShot.setEnabled(false);
			chkHeppatitusShot.setEnabled(false);
			chkXRAY.setEnabled(false);
			txtAttendNurse.setEnabled(false);
			txtComplaint.setEnabled(false);
			txtHeight.setEnabled(false);
			txtWeight.setEnabled(false);
			txtBloodPressure.setEnabled(false);
			txtPulse.setEnabled(false);
			txtUserId.setEnabled(false);
			txtTreatingDoctor.setEnabled(false);
			txtAppointDate.setEnabled(false);
			txtTemp.setEnabled(false);
			txtDiagnosis.setEnabled(false);
			
			}
		}
		if (p != null){
			txtUserId.setText(p.getLoginName());
			}
		
		btnCreate.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0){
			
				/*
				 * Data Integrity Checking before inputting to data base
				 */		
				boolean foundErr = false;
				checkIntegrity = new DataIntegrity(); // Can call methods to check data integrity
				
				//idErr.setVisible(false);
				doctorErr.setVisible(false);
				apptDateErr.setVisible(false);
				nurseErr.setVisible(false);
				bloodPrsErr.setVisible(false);
				pulseErr.setVisible(false);
				tempErr.setVisible(false);
				heightErr.setVisible(false);
				weightErr.setVisible(false);
				diagnosisErr.setVisible(false);
				
				//ID Check
				if(txtUserId.getText().equals("")){
					foundErr = true;
				}
//				else{ Commented out because users are not unique for treatment records-Christian
//					//check userid is in the patient list
//					String[] pIDList = myDataManager.getDataAtCol(GlobalVars.PATIENT_SHEET, "User Name", "User Name");
//					for(int i=0; i<pIDList.length; i++){
//						if(!pIDList[i].equals(txtUserId.getText())){
//							foundErr = true;
//							idErr.setVisible(true);
//						}
//					}
//				}
				
				//Doctor Check
				if(txtTreatingDoctor.getText().equals("")){
					foundErr = true;
					doctorErr.setText("Enter treating doctor");
					doctorErr.setVisible(true);
				}
//				else{
//					if(!checkIntegrity.isOnlyLetters(txtTreatingDoctor.getText())){
//						foundErr = true;
//						doctorErr.setText("Verify entered information");
//						doctorErr.setVisible(true);
//					}
//				}
				
				// Commented out because if there are spaces the data integrity checking will have a false positive - Kevin
				
				//appoint date Check
				if(txtAppointDate.getText().equals("")){
					foundErr = true;
					apptDateErr.setVisible(true);
				}
				
				//attending nurse Check
				if(txtAttendNurse.getText().equals("")){
					foundErr = true;
					nurseErr.setText("Enter attending nurse");
					nurseErr.setVisible(true);
				}
				else{
					if(!checkIntegrity.isOnlyLetters(txtAttendNurse.getText())){
						foundErr = true;
						nurseErr.setText("Verify entered information");
						nurseErr.setVisible(true);
					}
				}
				
				//symptom check
				if(txtComplaint.getText().equals("")){
					txtComplaint.setText("N/A");
				}
				
				//blood pressure check
				if(txtBloodPressure.getText().equals("")){
					foundErr = true;
					bloodPrsErr.setText("Enter blood pressure rate");
					bloodPrsErr.setVisible(true);
				}
				else{
					if(!checkIntegrity.isOnlyNumbers(txtBloodPressure.getText())){
						foundErr = true;
						bloodPrsErr.setText("Verify entered information");
						bloodPrsErr.setVisible(true);
					}
				}
				
				//pulse check
				if(txtPulse.getText().equals("")){
					foundErr = true;
					pulseErr.setText("Enter pulse rate");
					pulseErr.setVisible(true);
				}
				else{
					if(!checkIntegrity.isOnlyNumbers(txtPulse.getText())){
						foundErr = true;
						pulseErr.setText("Verify entered information");
						pulseErr.setVisible(true);
					}
				}
				
				//temperature Check
				if(txtTemp.getText().equals("")){
					foundErr = true;
					tempErr.setText("Enter temperature");
					tempErr.setVisible(true);
				}
				else{
					if(!checkIntegrity.isOnlyNumbers(txtTemp.getText())){
						foundErr = true;
						tempErr.setText("Verify entered information");
						tempErr.setVisible(true);
					}
				}
				
				//height Check
				if(txtHeight.getText().equals("")){
					foundErr = true;
					heightErr.setText("Enter height (ie. 7)");
					heightErr.setVisible(true);
				}
				else{
					if(!checkIntegrity.isOnlyNumbers(txtHeight.getText())){
						foundErr = true;
						heightErr.setText("Verify entered information");
						heightErr.setVisible(true);
					}
				}
				
				//weight Check
				if(txtWeight.getText().equals("")){
					foundErr = true;
					weightErr.setText("Enter weight (ie. 110)");
					weightErr.setVisible(true);
				}
				else{
					if(!checkIntegrity.isOnlyNumbers(txtWeight.getText())){
						foundErr = true;
						weightErr.setText("Verify entered information");
						weightErr.setVisible(true);
					}
				}
				
				//diagnosis check
				if(txtDiagnosis.getText().equals("")){
					foundErr = true;
					diagnosisErr.setVisible(true);
				}
				
				//if (checkIntegrity.isOnlyNumbers(txtWeight.getText()) 
				//&& checkIntegrity.isNotNull(txtComplaint.getText())) 
				//{ && checkIntegrity.isOnlyNumbers(txtLab.getText())) {
				if(!foundErr){
				treatRecord.updateTreatmentRecord(txtUserId.getText(), txtTreatingDoctor.getText(),
												  txtAttendNurse.getText(), txtHeight.getText(), 
												  txtWeight.getText(), txtComplaint.getText(), 
												  txtBloodPressure.getText(), txtPulse.getText(), 
												  txtTemp.getText(), txtDiagnosis.getText());
				
				myDataManager.setData(GlobalVars.TREATMENT_RECORD_SHEET, null, myDataManager.fillTreatmentArray(treatRecord), rowNumber); 
				final int labwork = calculateLabWork();
					if (myDataManager.getUserType() == GlobalVars.DOCTOR_USERTYPE) { // Only doctors can add doctors orders
						treatRecord.addDoctorsOrders(txtPrescription.getText(), labwork, 
													txtFollow.getText(), txtNotes.getText());
						myDataManager.setData(GlobalVars.TREATMENT_RECORD_SHEET, null, myDataManager.fillTreatmentArrayDoctor(treatRecord), rowNumber); 
						}
					treatmentFrame.dispose(); // Close frame, as is valid input data
				}
		
			}
		});

		final JButton btnCancel = new JButton("Cancel");
		btnCancel.setBounds(821, 602, 86, 28);
		btnCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0){
				treatmentFrame.dispose();
			}
		});

		final JLabel lblShotsinjections = new JLabel("Shots/Injections:");
		lblShotsinjections.setBounds(569, 81, 124, 16);
		
		final JLabel lblLabwork = new JLabel("Labwork:");
		lblLabwork.setBounds(569, 183, 68, 16);

		final JLabel lblScans = new JLabel("Scans");
		lblScans.setBounds(569, 299, 46, 16);
		treatmentFrame.getContentPane().setLayout(null);
		treatmentFrame.getContentPane().add(chkCTSCAN);
		treatmentFrame.getContentPane().add(chkMRI);
		treatmentFrame.getContentPane().add(lblScans);
		treatmentFrame.getContentPane().add(lblUserid);
		treatmentFrame.getContentPane().add(lblTreatingDoctor);
		treatmentFrame.getContentPane().add(lblAppointDate);
		treatmentFrame.getContentPane().add(lblAttendingNurse);
		treatmentFrame.getContentPane().add(lblSymptoms);
		treatmentFrame.getContentPane().add(lblHeight);
		treatmentFrame.getContentPane().add(lblBloodPressure);
		treatmentFrame.getContentPane().add(lblWeight);
		treatmentFrame.getContentPane().add(lblPulse);
		treatmentFrame.getContentPane().add(lblTemp);
		treatmentFrame.getContentPane().add(btnCreate);
		treatmentFrame.getContentPane().add(btnCancel);
		treatmentFrame.getContentPane().add(txtAttendNurse);
		treatmentFrame.getContentPane().add(txtAppointDate);
		treatmentFrame.getContentPane().add(txtTreatingDoctor);
		treatmentFrame.getContentPane().add(txtUserId);
		treatmentFrame.getContentPane().add(txtWeight);
		treatmentFrame.getContentPane().add(txtComplaint);
		treatmentFrame.getContentPane().add(txtPulse);
		treatmentFrame.getContentPane().add(txtBloodPressure);
		treatmentFrame.getContentPane().add(txtHeight);
		treatmentFrame.getContentPane().add(txtTemp);
		treatmentFrame.getContentPane().add(txtDiagnosis);
		treatmentFrame.getContentPane().add(lblDiagnosis);
		treatmentFrame.getContentPane().add(labWorkLabel);
		treatmentFrame.getContentPane().add(lblShotsinjections);
		treatmentFrame.getContentPane().add(lblNewLabel);
		treatmentFrame.getContentPane().add(txtFollow);
		treatmentFrame.getContentPane().add(lblNotes);
		treatmentFrame.getContentPane().add(lblPrescription);
		treatmentFrame.getContentPane().add(txtPrescription);
		treatmentFrame.getContentPane().add(txtNotes);
		treatmentFrame.getContentPane().add(chkSteroidShot);
		treatmentFrame.getContentPane().add(chkHeppatitusShot);
		treatmentFrame.getContentPane().add(chkHIV);
		treatmentFrame.getContentPane().add(chkCholesterolTest);
		treatmentFrame.getContentPane().add(chkTetanusShot);
		treatmentFrame.getContentPane().add(chkBloodTest);
		treatmentFrame.getContentPane().add(chkFluShot);
		treatmentFrame.getContentPane().add(chkUrinalysis);
		treatmentFrame.getContentPane().add(chkXRAY);
		treatmentFrame.getContentPane().add(lblLabwork);
		//treatmentFrame.getContentPane().add(idErr);
		treatmentFrame.getContentPane().add(doctorErr);
		treatmentFrame.getContentPane().add(apptDateErr);
		treatmentFrame.getContentPane().add(nurseErr);
		treatmentFrame.getContentPane().add(bloodPrsErr);
		treatmentFrame.getContentPane().add(pulseErr);
		treatmentFrame.getContentPane().add(tempErr);
		treatmentFrame.getContentPane().add(heightErr);
		treatmentFrame.getContentPane().add(weightErr);
		treatmentFrame.getContentPane().add(diagnosisErr);
		
		final JSeparator separator = new JSeparator();
		separator.setOrientation(SwingConstants.VERTICAL);
		separator.setBounds(424, 0, 18, 837);
		treatmentFrame.getContentPane().add(separator);
		
		final JSeparator separator_1 = new JSeparator();
		separator_1.setOrientation(SwingConstants.VERTICAL);
		separator_1.setBounds(439, 0, 18, 835);
		treatmentFrame.getContentPane().add(separator_1);
		
		final JLabel lblTreatmentRecord = new JLabel("Treatment Record");
		lblTreatmentRecord.setFont(new Font("Lucida Grande", Font.BOLD, 13));
		lblTreatmentRecord.setBounds(120, 20, 166, 16);
		treatmentFrame.getContentPane().add(lblTreatmentRecord);
		
		final JLabel lblDoctorsOrders = new JLabel("Doctor's Orders");
		lblDoctorsOrders.setFont(new Font("Lucida Grande", Font.BOLD, 13));
		lblDoctorsOrders.setBounds(733, 20, 111, 16);
		treatmentFrame.getContentPane().add(lblDoctorsOrders);
		treatmentFrame.setVisible(true);

		if (myDataManager.getUserType() == GlobalVars.NURSE_USERTYPE) {
			txtPrescription.setEnabled(false);
			// disable all doctors orders
			txtFollow.setEnabled(false);
			txtNotes.setEnabled(false);
			txtAppointDate.setEnabled(false);
			chkFluShot.setEnabled(false);
			chkBloodTest.setEnabled(false);
			chkCholesterolTest.setEnabled(false);
			chkMRI.setEnabled(false);
			chkCTSCAN.setEnabled(false);
			chkHIV.setEnabled(false);
			chkUrinalysis.setEnabled(false);
			chkSteroidShot.setEnabled(false);
			chkTetanusShot.setEnabled(false);
			chkTetanusShot.setEnabled(false);
			chkHeppatitusShot.setEnabled(false);
			chkXRAY.setEnabled(false);
			
		}
		
	}

	/**
	 * Method populateCheckBoxes.
	 * @param labWorkNumber int
	 */
	private void populateCheckBoxes(int labWorkNumber){ // $codepro.audit.disable cyclomaticComplexity
		final int[] checkBoxPopulate = TreatmentRecord.getBillablesReceived(labWorkNumber);
		if (checkBoxPopulate[0] == 1){
			chkFluShot.setSelected(true);
		}
		if (checkBoxPopulate[1] == 1){
			chkTetanusShot.setSelected(true);
		}
		if (checkBoxPopulate[2] == 1){
			chkHeppatitusShot.setSelected(true);
		}
		if (checkBoxPopulate[3] == 1){
			chkSteroidShot.setSelected(true);
		}
		if (checkBoxPopulate[4] == 1){
			chkUrinalysis.setSelected(true);
		}
		if (checkBoxPopulate[5] == 1){
			chkBloodTest.setSelected(true);
		}
		if (checkBoxPopulate[6] == 1){
			chkCholesterolTest.setSelected(true);
		}
		if (checkBoxPopulate[7] == 1){
			chkHIV.setSelected(true);
		}
		if (checkBoxPopulate[8] == 1){
			chkXRAY.setSelected(true);
		}
		if (checkBoxPopulate[9] == 1){
			chkCTSCAN.setSelected(true);
		}
		if (checkBoxPopulate[10] == 1){
			chkMRI.setSelected(true);
		}
		return;
	}
	
	/**
	 * Method calculateLabWork.
	 * @return int
	 */
	private int calculateLabWork(){ // $codepro.audit.disable cyclomaticComplexity
		int myLabWork= 0;
		if (chkFluShot.isSelected()){
			myLabWork+=1;
		}
		if (chkTetanusShot.isSelected()){
			myLabWork+=2;
		}
		if (chkHeppatitusShot.isSelected()){
			myLabWork+=4;
		}
		if (chkSteroidShot.isSelected()){
			myLabWork+=8;
		}
		if (chkUrinalysis.isSelected()){
			myLabWork+=16;
		}
		if (chkBloodTest.isSelected()){
			myLabWork+=32;
		}
		if (chkCholesterolTest.isSelected()){
			myLabWork+=64;
		}
		if (chkHIV.isSelected()){
			myLabWork+=128;
		}
		if (chkXRAY.isSelected()){
			myLabWork+=256;
		}
		if (chkCTSCAN.isSelected()){
			myLabWork+=512;
		}
		if (chkMRI.isSelected()){
			myLabWork+=1024;
		}
		return myLabWork; 
	}
	
	/**
	 * Method initialize.
	 * @param dataManager DataManager
	 * @param p Patient
	 
	private void initialize(DataManager dataManager, Patient p) { // If a Patient object is passed in
	
	}
	**/
}


